from langdev_helper.llm.lcex import llm_lcex as model

from langchain_core.prompts import ChatPromptTemplate


system_template = """
## 配置
- **题材**: {theme}
- **篇幅**: {length}
- **手法**: {technique}
- **主角**: {protagonist}
- **流派**：{genre}

## 工作流
- 基于上述配置，生成小说的大纲
"""

prompt_template = ChatPromptTemplate.from_messages(
    [("system", system_template), ("user", "{text}")]
)

prompt = prompt_template.invoke({"theme": "科幻", "length": "微型", "technique": "第一人称", "protagonist": "厉飞羽", "genre": "魔幻现实主义", "text": "执行工作流"})

resp = model.invoke(prompt)
print(resp.content)